package com.jiumi.baseconfig.service.impl;

import java.util.List;
import com.jiumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jiumi.baseconfig.mapper.BaseMealMapper;
import com.jiumi.baseconfig.domain.BaseMeal;
import com.jiumi.baseconfig.service.IBaseMealService;

/**
 * 课程套餐Service业务层处理
 *
 * @author jiumi
 * @date 2023-05-21
 */
@Service
public class BaseMealServiceImpl implements IBaseMealService
{
    @Autowired
    private BaseMealMapper baseMealMapper;

    /**
     * 查询课程套餐
     *
     * @param id 课程套餐主键
     * @return 课程套餐
     */
    @Override
    public BaseMeal selectBaseMealById(Long id)
    {
        return baseMealMapper.selectBaseMealById(id);
    }

    /**
     * 查询课程套餐列表
     *
     * @param baseMeal 课程套餐
     * @return 课程套餐
     */
    @Override
    public List<BaseMeal> selectBaseMealList(BaseMeal baseMeal)
    {
        return baseMealMapper.selectBaseMealList(baseMeal);
    }

    /**
     * 新增课程套餐
     *
     * @param baseMeal 课程套餐
     * @return 结果
     */
    @Override
    public int insertBaseMeal(BaseMeal baseMeal)
    {
        baseMeal.setCreateTime(DateUtils.getNowDate());
        return baseMealMapper.insertBaseMeal(baseMeal);
    }

    /**
     * 修改课程套餐
     *
     * @param baseMeal 课程套餐
     * @return 结果
     */
    @Override
    public int updateBaseMeal(BaseMeal baseMeal)
    {
        baseMeal.setUpdateTime(DateUtils.getNowDate());
        return baseMealMapper.updateBaseMeal(baseMeal);
    }

    /**
     * 批量删除课程套餐
     *
     * @param ids 需要删除的课程套餐主键
     * @return 结果
     */
    @Override
    public int deleteBaseMealByIds(Long[] ids)
    {
        return baseMealMapper.deleteBaseMealByIds(ids);
    }

    /**
     * 删除课程套餐信息
     *
     * @param id 课程套餐主键
     * @return 结果
     */
    @Override
    public int deleteBaseMealById(Long id)
    {
        return baseMealMapper.deleteBaseMealById(id);
    }
}
